package com.example.customview.head_hover

import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.android.baselibrary.base.BaseDBFragment
import com.android.baselibrary.recycler.linear
import com.example.customview.R
import com.example.customview.databinding.FragmentChildBinding
import com.android.baselibrary.customview.BaseViewHolder

class ChildFragment :BaseDBFragment<FragmentChildBinding>(R.layout.fragment_child) {
    private val datas by lazy {
        listOf("Apple", "Banana", "Orange", "Watermelon",
            "Apple", "Banana", "Orange", "Watermelon",
            "Pear","Grape", "Pineapple", "Strawberry", "Cherry", "Mango",
            "Apple", "Banana", "Orange", "Watermelon",
            "Apple", "Banana", "Orange", "Watermelon",
            "Pear","Grape", "Pineapple", "Strawberry", "Cherry", "Mango")
    }
    override fun initView() {
     mBinding.recyclerView.linear().adapter = object :RecyclerView.Adapter<BaseViewHolder>(){
         override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
             return BaseViewHolder(
                 TitleView(parent.context)
             )
         }

         override fun getItemCount(): Int {
            return datas.size
         }

         override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
             holder.bind(TitleViewViewModel(datas[position]))
         }

     }
    }
}
fun RecyclerView.bindAdapter(){

}